package org.p2psimulator.config;

import org.p2psimulator.entity.ProtocolType;
import org.p2psimulator.factory.idfactory.IdFactory;

public class ProtocolConfig extends AbstractConfig {

    ProtocolType type;
    IdFactory factory;
    double bayesianTrustWorthiness = 0.5;
    double bayesianThresold = 0.01;
    double bayesianFirstHandWeight = 0.5;
    double bayesianSecondHandWeight = 0.2;
    double eigenAfactor = 0.001;
    double eigenBasicTrust = 0.001;
    double stormWitnessSize = 5;
    double stormFeedbackNumber = 10;

    public ProtocolConfig(ProtocolType type, IdFactory factory) {
        super();
        this.type = type;
        this.factory = factory;
    }

    public ProtocolType getType() {
        return type;
    }

    public void setType(ProtocolType type) {
        this.type = type;
    }

    @Override
    public boolean isComplete() {

        if (type == null) {
            return false;
        }
        if (factory == null) {
            return false;
        }

        return true;
    }

    public IdFactory getFactory() {
        return factory;
    }

    public void setFactory(IdFactory factory) {
        this.factory = factory;
    }

    public double getBayesianTrustWorthiness() {
        return bayesianTrustWorthiness;
    }

    public void setBayesianTrustWorthiness(double bayesianTrustWorthiness) {
        this.bayesianTrustWorthiness = bayesianTrustWorthiness;
    }

    public double getBayesianThresold() {
        return bayesianThresold;
    }

    public void setBayesianThresold(double bayesianThresold) {
        this.bayesianThresold = bayesianThresold;
    }

    public double getBayesianFirstHandWeight() {
        return bayesianFirstHandWeight;
    }

    public void setBayesianFirstHandWeight(double bayesianWeight) {
        this.bayesianFirstHandWeight = bayesianWeight;
    }

    public double getBayesianSecondHandWeight() {
        return bayesianSecondHandWeight;
    }

    public void setBayesianSecondHandWeight(double bayesianSecondHandWeight) {
        this.bayesianSecondHandWeight = bayesianSecondHandWeight;
    }

    public double getEigenAfactor() {
        return eigenAfactor;
    }

    public void setEigenAfactor(double eigenAfactor) {
        this.eigenAfactor = eigenAfactor;
    }

    public double getEigenBasicTrust() {
        return eigenBasicTrust;
    }

    public void setEigenBasicTrust(double eigenBasicTrust) {
        this.eigenBasicTrust = eigenBasicTrust;
    }

    public Double getStormWitnessSize() {
        return stormWitnessSize;
    }

    public void setStormWitnessSize(double stormWitnessSize) {
        this.stormWitnessSize = stormWitnessSize;
    }

    public double getStormFeedbackNumber() {
        return stormFeedbackNumber;
    }

    public void setStormFeedbackNumber(double stormFeedbackNumber) {
        this.stormFeedbackNumber = stormFeedbackNumber;
    }

    
}
